package com.gaofei.sysmanager.kafka;//package com.gaofei.sysmanager.kafka;
//
//import com.gaofei.sysmanager.common.MsgUtil;
//import org.apache.kafka.clients.consumer.ConsumerRecord;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.kafka.annotation.KafkaListener;
//import org.springframework.kafka.support.Acknowledgment;
//import org.springframework.stereotype.Component;
//import sun.reflect.generics.tree.VoidDescriptor;
//
///**
// * @Auther: 86156
// * @Date: 2021/11/3 10:37
// * @Description:
// */
//@Component
//public class MyListenner {
//    @Autowired
//    private RedisTemplate redisTemplate;
//
//    @Autowired
//    private MsgUtil msgUtil;
//
////    @KafkaListener(topics = "1904",id = "ack",containerFactory = "ackContainerFactory")
//    public void kafukaMyLinstenner(ConsumerRecord<String ,String> date, Acknowledgment ack){
//        //获取的值
//        String value = date.value();
//        String key = date.key();
//        Boolean aBoolean = redisTemplate.hasKey(key);
//        if(aBoolean){
//            System.out.println("内容重复了!!!");
//
//        }else{
//            //发送邮件
////            msgUtil.sendTextEmail("1624846630@qq.com","你是大沙雕",value);
//            //手动提交防止丢失消息
//            ack.acknowledge();
//        }
//    }
//
//}
